/*
 * @Author: your name
 * @Date: 2020-06-12 15:22:23
 * @LastEditTime: 2020-06-17 13:52:30
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /react-admin-ant/src/pages/Demo/fakeData.js
 */ 



const pageSize = 200
const host = 'http://picsum.photos'

const words = []
const images = []

function fakerData (start = 0, useImage = true) {
  const a = []
  for (let i = start; i < start + pageSize; i+=1) {
    const rw = (1 + Math.random()) * 100
    const rh = (1 + Math.random()) * 100

    a.push({
      id: i,
      image: useImage ? images[i] || (images[i] = `${host}/${Math.trunc(rw)}/${Math.trunc(rh)}`) : undefined,
      words: words[i] ,
      paragraphs: i
    })
  }

  return a
}

export default fakerData